import { Module } from 'vuex';
import { RouteRecordRaw } from 'vue-router';
import { SET_ROUTES } from '../constant';
// import { asyncRoutes, constantRoutes } from '@/router/routes'

interface IPermissionState {
  routes: Array<RouteRecordRaw>;
  addRoutes: Array<RouteRecordRaw>;
}

export default {
  namespaced: true,
  state() {
    return {
      routes: [],
      addRoutes: [],
    };
  },
  mutations: {
    [SET_ROUTES]: (state, payload) => {
      state.addRoutes = payload;
      // state.routes = constantRoutes.concat(payload);
    },
  },
  actions: {

  },
} as Module<IPermissionState, any>;
